package com.songlanyun.modules.pointtobalace.controller;

import com.songlanyun.common.utils.PageUtils;
import com.songlanyun.common.utils.R;
import com.songlanyun.modules.chain.model.dto.UserWithdrawalDTO;
import com.songlanyun.modules.pointtobalace.entity.BalanceToPointStatistics;
import com.songlanyun.modules.pointtobalace.service.BalanceToPointRecordService;
import com.songlanyun.modules.user.controller.AbstractController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;


/**
 * 余额兑换积分
 * @author zhangqh
 */
@RestController
@RequestMapping("api/admin/balanceToPointRecord")
public class BalanceToPointCnhdController extends AbstractController {
    @Autowired
    private BalanceToPointRecordService balanceToPointRecordService;


    @RequestMapping("/page")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = balanceToPointRecordService.queryPage(params);
        return R.ok().put("page", page);
    }

    @RequestMapping("/statistics")
    public R statistics(@RequestParam Map<String, Object> params){
        BalanceToPointStatistics data = balanceToPointRecordService.getPointToBalanceStatistics(params);
        return R.ok().put("data", data);
    }




}
